<!--
 * @Date: 2019-11-11 10:48:37
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2020-03-04 17:53:48
 * @describe: 
 -->
<template>
  <transition name="el-fade-in-linear">
    <router-view />
  </transition>
</template>

<script>
import Cookies from 'js-cookie'
import { messages } from '@/i18n'
export default {
  watch: {
    '$i18n.locale': 'i18nHandle'
  },
  created () {
    this.i18nHandle(this.$i18n.locale)
  },
  mounted(){
     
  },
  methods: {
    i18nHandle (val, oldVal) {
      Cookies.set('language', val)
      document.querySelector('html').setAttribute('lang', val)
      document.title = messages[val].brand.lg
      // 非登录页面，切换语言刷新页面
      if (this.$route.name !== 'login' && oldVal) {
        window.location.reload()
      }
    }
  }
}
</script>
<style>
::-webkit-scrollbar {
    width: 8px;
    height: 10px;
    /* background-color: #3e8ef7; */
}

::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.123);
    /* border-radius: 10px; */
    background-color: rgb(255, 255, 255);
}

::-webkit-scrollbar-thumb {
    border-radius: 10px;
    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.11);
    background-color: #a7c6ff;
}
::-webkit-scrollbar-thumb:hover {
    background-color: #3e8ef7;
}

</style>